package com.hex.ds.hdtp.core.inf.common.base;

import cn.hutool.json.JSONObject;
import com.hex.bigdata.hbda.utils.SecurityUtils;

public class BaseUtil {

    /**
     * 获取用户id
     * @return
     */
    public static String getUserId(){
        try {
            return SecurityUtils.getUsername();
        }catch (Exception e){

        }
        return null;
    }

    /**
     * 获取用户名
     * @return
     */
    public static String getNickName(){
        try {
            Object obj = SecurityUtils.getUserDetails();
            return (String)(new JSONObject(obj)).get("nickName", String.class);
        }catch (Exception e){

        }
        return null;
    }
}
